from . import main_blueprint as main
from flask_login import login_required
from flask import render_template, current_app, jsonify, request, redirect, url_for
from ..decorator import set_response_no_cache


@main.route('/')
@login_required
@set_response_no_cache
def index():
    return redirect(url_for('main.dashboard'))


@main.route('/<path>')
def get_file(path):
    download_dir = current_app.config.get('ROOT_DIR')
    return current_app.send_static_file(path)


@main.route('/test')
def get_test():
    print('test')
    return 'test_route'


@main.route('/dashboard')
def dashboard():
    print(request.endpoint)
    return render_template('dashboard/index.html')


@main.route('/setting')
def setting():
    return render_template('setting/index.html')





